#ifndef DWGLINEITEM_H
#define DWGLINEITEM_H

#include "dwgobjectitem.h"

class DwgLineItem : public DwgObjectItem
{
    Q_OBJECT
public:
    DwgLineItem();
    QPointF mStartPt,mEndPt;    // 先设置为公开成员，后面再修改为私有成员，并使用 set 和 get 来获取和赋值

    // QGraphicsItem interface

protected:
    void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
    void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;

public:
    QRectF boundingRect() const override;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;

    void DrawSnapRect(QPainter *painter, QPointF cpt);

    // QGraphicsItem interface
public:
    QPainterPath shape() const override;
};

#endif // DWGLINEITEM_H
